﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PCS_Linh.lab01
{
    class Calculator
    {
        public void run()
        {

            Console.WriteLine("Please enter side a: ");
            double a = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Please enter side b: ");
            double b = Convert.ToDouble(Console.ReadLine());
            Console.WriteLine("Please enter side c: ");
            double c = Convert.ToDouble(Console.ReadLine());

            if (a > 0 || b > 0 || c > 0)
            {
                double perimeter = a + b + c;
                double p = perimeter / 2;
                double area = Math.Sqrt(p * (p - a) * (p - b) * (p - c));
                Console.WriteLine("The perimeter of this triangle is: {0,10:0.0000}", perimeter);
                Console.WriteLine("The area of this triangle is: {0,10:0.0000}", area);
            }
            else
            {
                Console.WriteLine("The radius must be a positive number");
            }
        }
    }
}
